package com.example.news.controller;

import com.example.news.pojo.GoodsType;
import com.example.news.service.IGoodsTypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goodsType")
@RequiredArgsConstructor
public class GoodsTypeController {

    private final IGoodsTypeService goodsTypeService;


    //接收参数；转发结果
    @GetMapping
    public List<GoodsType> queryGoodsType(String name, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
                                          Integer pageSize){
        return goodsTypeService.queryGoodsType(name, pageNo, pageSize);
    }
}
